package com.cwj;

import org.openjdk.jol.info.ClassLayout;
import org.openjdk.jol.info.GraphLayout;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Chenwujie
 * @date: 2021-06-11 10:06
 */
public class SystemTest {
    public static void main(String[] args) {
        Object o = new Object();
        Map<String, Object> map = new HashMap<>();
        System.out.println(Integer.toHexString(System.identityHashCode(o)));
        System.out.println(Integer.toHexString(System.identityHashCode(map)));
        System.out.println(Integer.toHexString(System.identityHashCode(HashMap.class)));
        map.put("a", o);
        map.put("b", "b");
        map.put("c", 3);

        System.out.println(GraphLayout.parseInstance(map).toPrintable());
        System.out.println(ClassLayout.parseInstance(map).toPrintable());
    }
}
